#include <stdio.h>
int sum(int n)
{
	int total = n;
	int empty = n;
	while (empty >= 2)
	{
		total += (empty / 2);
		empty = (empty / 2) + empty % 2;
	}
	return total;
}
int main()
{
	int n = 20;
	printf("%d", sum(n));
	return 0;
}